package com.rockcent.mall.lib.repository;

import com.rockcent.common.domain.enumclass.Whether;
import com.rockcent.mall.lib.domain.Recommend;
import org.hibernate.annotations.Where;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * Created by zhangjh 2016/10/9.
 */
@Repository
public interface RecommendRepository extends JpaRepository<Recommend, Long>, JpaSpecificationExecutor,RecommendRepositoryCustom {
    List<Recommend> findByMallIdAndIsDelete(Long mallId, Whether whether);

    Recommend findByMallIdAndMerchantId(Long id, Long merchantId);

    Long countByMallIdAndIsDelete(Long id, Whether isdelete);
}
